package school.xauat.offershow.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import school.xauat.offershow.pojo.Comment;
import school.xauat.offershow.serice.CommentService;

/**
 * @author ：zsy
 * @date ：Created 2021/12/16 0:52
 * @description：
 */
@RestController
@Api(tags = {"评论Controller"})
public class CommentController {

    @Autowired
    CommentService commentService;

    @PostMapping("/comment/add")
    @ApiOperation("添加评论")
    public boolean add(@RequestBody Comment comment) {
        int insert = commentService.insert(comment);
        return insert == 1;
    }
}
